<!DOCTYPE html>
<html lang="cn" xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{_fragments::common_header(~{::title})}">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">  
   <link href="../../static/css/bootstrap.min.css" th:href="@{/static/css/bootstrap.min.css}" rel="stylesheet">
    <script src="../../static/js/jquery-3.2.1.js" th:src="@{/static/js/jquery-3.2.1.js}"></script>
    <script src="../../static/js/bootstrap.min.js" th:src="@{/static/js/bootstrap.min.js}"></script>
    <title>逍遥论坛 › 修改版块信息</title>
</head>
<body>
<!-- 引入header文件 -->
<header th:replace=" _fragments:: header"></header>

<div style="width: 50%;margin:1% 2% 1% 5%;float: left;">
    <div class="panel panel-default" id="main" style="">
        <div class="panel-heading" style="background-color: white">
            <a href="<%=basePath%>">逍遥论坛</a> › 修改版块信息 ›  <span th:text="${forum.forumName}"></span>
        </div>

        <div class="panel-body">
            <form  action="modifyForumInfo.do" id="myForumUpdateForm" method="POST" class="form-horizontal" role="form">
                <div class="form-group">
                    <label class="col-sm-2 control-label">版块ID</label>
                    <div class="col-sm-5">
                        <p class="form-control-static" th:text="${forum.forumId}">${forum.forum_id}</p>
                    </div>
                    <div class="col-sm-5">
                        <input type="text"  name="forumId" th:value="${forum.forumId}" readonly />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">版块名</label>
                    <div class="col-sm-5">
                        <p class="form-control-static"th:text="${forum.forumName}" >${forum.forum_name}</p>
                    </div>
                    <div class="col-sm-5">
                        修改版块名：<br>
                        <input type="text"  name="forumName" th:value="${forum.forumName}" required />
                    </div>
                </div>
                <input class="btn btn-warning" type="button" value="修改" onclick="modifyForum_confirm()"/>
                <input class="btn btn-default" type="reset" value="重填"/>
                <a type="button" class="btn btn-default"
                       style="margin-left: 10%" th:href="toForumManagePage.do">返回</a>
            </form>
        </div>
    </div>
</div>

<!-- 引入侧边栏文件 -->
<!-- <%@ include file="side.jsp"%> -->
<nav th:replace="side:: nav"></nav>

<!-- 引入footer文件 -->
<!-- <%@ include file="footer.jsp"%> -->
<footer th:replace="_fragments:: footer"></footer>

<script>
    function modifyForum_confirm()
    {
        var form = document.getElementById("myForumUpdateForm"); // 由id获取表单
        var forumName = form.forumName.value; // 版块名
        if (forumName == null || forumName == ''){
            alert("请输入版块名！");
        }else {
            var r=confirm("确定修改?")
            if (r==true)
            {
                form.submit();
            } else { }
        }
    }
</script>

</body>
</html>